home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ADSPSecure.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  3.8 KB  |  120 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ADSPSecure.p
  3.  
  4.      Contains:    Secure AppleTalk Data Stream Protocol Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ADSPSecure;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __ADSPSECURE__}
  28. {$SETC __ADSPSECURE__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ADSPSecureIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __ADSP__}
  38. {$I ADSP.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __OCEAUTHDIR__}
  41. {$I OCEAuthDir.p}
  42. {$ENDC}
  43.  
  44.  
  45. {$PUSH}
  46. {$ALIGN MAC68K}
  47. {$LibExport+}
  48.  
  49. { New ADSP control codes
  50.  
  51.  * open a secure connection }
  52.  
  53. CONST
  54.     sdspOpen                    = 229;
  55.  
  56. {
  57. For secure connections, the eom field of ioParams contains two single-bit flags
  58. (instead of a zero/non-zero byte). They are an encrypt flag (see below), and an
  59. eom flag.  All other bits in that field should be zero.
  60.  
  61. To write an encrypted message, you must set an encrypt bit in the eom field of
  62. the ioParams of your write call. Note: this flag is only checked on the first
  63. write of a message (the first write on a connection, or the first write following
  64. a write with eom set.
  65. }
  66.     dspEOMBit                    = 0;                            {  set if EOM at end of write  }
  67.     dspEncryptBit                = 1;                            {  set to encrypt message  }
  68.  
  69.     dspEOMMask                    = $01;
  70.     dspEncryptMask                = $02;
  71.  
  72.  
  73. {
  74. Define an ADSPSecure parameter block, as used for the secure Open call.
  75.  
  76.  * size of ADSPSecure workspace }
  77.     sdspWorkSize                = 2048;
  78.  
  79.  
  80. TYPE
  81.     TRSecureParamsPtr = ^TRSecureParams;
  82.     TRSecureParams = RECORD
  83.         localCID:                UInt16;                                    {  local connection id  }
  84.         remoteCID:                UInt16;                                    {  remote connection id  }
  85.         remoteAddress:            AddrBlock;                                {  address of remote end  }
  86.         filterAddress:            AddrBlock;                                {  address filter  }
  87.         sendSeq:                UInt32;                                    {  local send sequence number  }
  88.         sendWindow:                UInt16;                                    {  send window size  }
  89.         recvSeq:                UInt32;                                    {  receive sequence number  }
  90.         attnSendSeq:            UInt32;                                    {  attention send sequence number  }
  91.         attnRecvSeq:            UInt32;                                    {  attention receive sequence number  }
  92.         ocMode:                    SInt8;                                    {  open connection mode  }
  93.         ocInterval:                SInt8;                                    {  open connection request retry interval  }
  94.         ocMaximum:                SInt8;                                    {  open connection request retry maximum  }
  95.         secure:                    BOOLEAN;                                {   --> TRUE if session was authenticated  }
  96.         sessionKey:                AuthKeyPtr;                                {  <--> encryption key for session  }
  97.         credentialsSize:        UInt32;                                    {   --> length of credentials  }
  98.         credentials:            Ptr;                                    {   --> pointer to credentials  }
  99.         workspace:                Ptr;                                    {   --> pointer to workspace for connection align on even boundary and length = sdspWorkSize  }
  100.         recipient:                AuthIdentity;                            {   --> identity of recipient (or initiator if active mode  }
  101.         issueTime:                UTCTime;                                {   --> when credentials were issued  }
  102.         expiry:                    UTCTime;                                {   --> when credentials expiry  }
  103.         initiator:                RecordIDPtr;                            {  <--  RecordID of initiator returned here. Must give appropriate Buffer to hold RecordID (Only for passive or accept mode)  }
  104.         hasIntermediary:        BOOLEAN;                                {  <--  will be set if credentials has an intermediary  }
  105.         filler1:                BOOLEAN;
  106.         intermediary:            RecordIDPtr;                            {  <--  RecordID of intermediary returned here. (If intermediary is found in credentials Must give appropriate Buffer to hold RecordID (Only for passive or accept mode)  }
  107.     END;
  108.  
  109.  
  110. {$ALIGN RESET}
  111. {$POP}
  112.  
  113. {$SETC UsingIncludes := ADSPSecureIncludes}
  114.  
  115. {$ENDC} {__ADSPSECURE__}
  116.  
  117. {$IFC NOT UsingIncludes}
  118.  END.
  119. {$ENDC}
  120.